package es.decloud.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import es.decloud.dao.CentroDao;
import es.decloud.model.Centro;
import es.decloud.service.CentroManager;

/**
 * Implementation of CentroManager interface.
 * */
@Service("centroManager")
public class CentroManagerImpl extends GenericManagerImpl<Centro, Long> implements CentroManager {
	CentroDao centroDao;

	@Autowired
	public CentroManagerImpl(CentroDao centroDao) {
		super(centroDao);
		this.centroDao = centroDao;
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Centro> getCentros(Centro centro) {
		return centroDao.getAll();
	}

	/**
	 * {@inheritDoc}
	 */
	public Centro getCentro(String nombre) {
		return centroDao.getCentroByNombre(nombre);
	}

	/**
	 * {@inheritDoc}
	 */
	public Centro saveCentro(Centro centro) {
		return centroDao.save(centro);
	}

}